/*
 * @Description:表格数据接口
 * @Autor: scy😊
 * @Date: 2021-01-12 11:31:47
 * @LastEditors: scy😊
 * @LastEditTime: 2021-01-23 17:15:26
 */
import https from '@/utils/https'

export const listMenu = (params: any) => {
  return https({
    url: '/system/menu/list',
    method: 'get',
    params: params
  })
}

// 查询菜单详细
export const getMenu = (menuId: Number) => {
  return https({
    url: '/system/menu/' + menuId,
    method: 'get'
  })
}

// 查询菜单下拉树结构
export const treeselect = () => {
  return https({
    url: '/system/menu/treeselect',
    method: 'get'
  })
}

// 根据角色ID查询菜单下拉树结构
export const roleMenuTreeselect = (roleId: Number) => {
  return https({
    url: '/system/menu/roleMenuTreeselect/' + roleId,
    method: 'get'
  })
}

// 新增菜单
export const addMenu = (data: any) => {
  return https({
    url: '/system/menu',
    method: 'post',
    data: data
  })
}

// 修改菜单
export const updateMenu = (data: any) => {
  return https({
    url: '/system/menu',
    method: 'put',
    data: data
  })
}

// 删除菜单
export const delMenu = (menuId: Number) => {
  return https({
    url: '/system/menu/' + menuId,
    method: 'delete'
  })
}
